#ifndef _H_UI_H_
#define _H_UI_H_

typedef unsigned char ui_position_type;
typedef unsigned char ui_color_type;

typedef struct
{
    ui_position_type last_x;
    ui_position_type last_y;
    ui_position_type ui_width;
    ui_position_type ui_height;
    void (*ui_draw_point)(ui_position_type x, ui_position_type y, ui_color_type color);
    void (*ui_draw)(void);
    void (*ui_clear)(ui_color_type color);
}h_ui_t;

typedef enum
{
    h_ui_ok = 0,
    h_ui_null,
    ui_draw_point_null,
    ui_draw_null,
}h_ui_state;

extern h_ui_state h_ui_init(h_ui_t *ui_t, void *draw_point_f, \
                             void *draw_f, void *clear_f, ui_position_type width, ui_position_type height);
extern h_ui_state h_ui_clear(h_ui_t *ui_t, ui_color_type color);
extern h_ui_state h_ui_moveTo(h_ui_t *ui_t, ui_position_type x, ui_position_type y);
extern h_ui_state h_ui_draw_line(h_ui_t *ui_t, ui_position_type x, ui_position_type y, ui_color_type color);
// extern h_ui_state h_ui_draw_line(h_ui_t *ui_t, ui_position_type sx, ui_position_type sy, \
//                                  ui_position_type ex, ui_position_type ey, ui_color_type color);

extern h_ui_state h_ui_draw_pic_with_single_color(h_ui_t *ui_t, ui_position_type x, ui_position_type y, \
                                      ui_position_type width, ui_position_type height, unsigned char *pic);
extern h_ui_state h_ui_draw_char_with_single_color(h_ui_t *ui_t, ui_position_type x, ui_position_type y, unsigned char data);
extern h_ui_state h_ui_draw_string_len_with_single_color(h_ui_t *ui_t, ui_position_type x, ui_position_type y, \
                                                   unsigned char *str, signed int len);
extern h_ui_state h_ui_draw_string_len_auto_row_with_single_color(h_ui_t *ui_t, ui_position_type x, ui_position_type y, \
                                                           signed int row_char_max_num, signed int colunm_char_max_num, \
                                                           unsigned char *str, signed int len);
#endif

